package com.cn.fangshuo.util;

import cn.hutool.core.date.DateUtil;
import cn.hutool.core.date.LocalDateTimeUtil;
import lombok.experimental.UtilityClass;

import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.ZoneOffset;
import java.time.format.DateTimeFormatter;

@UtilityClass
public class TimeUtil extends DateUtil {

    public static String format(LocalDateTime time, String format){
        return LocalDateTimeUtil.format(time, DateTimeFormatter.ofPattern(format));
    }

    public static String format(LocalDateTime time){
        return LocalDateTimeUtil.format(time, "yyyy-MM-dd HH:mm:ss");
    }

}
